import React, { useState, useCallback } from 'react'
import type { FC, PropsWithChildren } from 'react'
import { Modal } from 'antd'

interface IProps {
  isVisiable: boolean
  changeVisiable: (show: boolean) => void
  width?: number
  style?: Record<string, any>
  title?: string
}

const MyDialog: FC<PropsWithChildren<IProps>> = ({
  isVisiable,
  changeVisiable,
  width = 800,
  style = { top: 30 },
  children = null,
  title = '新增用户信息'
}) => {
  return (
    <Modal
      title={title}
      open={isVisiable}
      onCancel={() => {
        changeVisiable(false)
      }}
      footer={null}
      width={width}
      style={style}
      maskClosable={false}
    >
      {children}
    </Modal>
  )
}

export default MyDialog
